<html>
<head><meta charset="utf-8"><title>skipped unsafe blocks inside closures #85435 · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/skipped.20unsafe.20blocks.20inside.20closures.20.2385435.html">skipped unsafe blocks inside closures #85435</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="239793906"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/skipped%20unsafe%20blocks%20inside%20closures%20%2385435/near/239793906" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/skipped.20unsafe.20blocks.20inside.20closures.20.2385435.html#239793906">(May 21 2021 at 18:31)</a>:</h4>
<p>just a few notes on issue <a href="https://github.com/rust-lang/rust/issues/85435">#85435</a>: I can confirm it is injected by PR <a href="https://github.com/rust-lang/rust/issues/83521">#83521</a></p>



<a name="239794068"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/skipped%20unsafe%20blocks%20inside%20closures%20%2385435/near/239794068" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/skipped.20unsafe.20blocks.20inside.20closures.20.2385435.html#239794068">(May 21 2021 at 18:32)</a>:</h4>
<p>one notable thing about that PR is that it removed <a href="https://github.com/rust-lang/rust/pull/83521/files#diff-aa88b11ac1dc1f4c272cab12feeba67b2462d911de183c22a117af412a651ea6L183">a feature-gate guard, here</a>. I can understand why the guard was removed, given the nature of the PR</p>



<a name="239794253"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/skipped%20unsafe%20blocks%20inside%20closures%20%2385435/near/239794253" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/skipped.20unsafe.20blocks.20inside.20closures.20.2385435.html#239794253">(May 21 2021 at 18:33)</a>:</h4>
<p>but I am now wondering if one will see the same bug on earlier PR’s by <em>adding</em> that feature gate to the test illustrating the bug</p>



<a name="239794315"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/skipped%20unsafe%20blocks%20inside%20closures%20%2385435/near/239794315" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/skipped.20unsafe.20blocks.20inside.20closures.20.2385435.html#239794315">(May 21 2021 at 18:34)</a>:</h4>
<p>(which would help explain why so many of us were mystified to how the changes in this PR could have injected a bug like this.)</p>



<a name="239794604"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/skipped%20unsafe%20blocks%20inside%20closures%20%2385435/near/239794604" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/skipped.20unsafe.20blocks.20inside.20closures.20.2385435.html#239794604">(May 21 2021 at 18:36)</a>:</h4>
<p>And the answer is, “Yes.”: enabling the feature gate exposes the bug. It was already in the compiler before this PR.</p>



<a name="239794760"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/skipped%20unsafe%20blocks%20inside%20closures%20%2385435/near/239794760" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/skipped.20unsafe.20blocks.20inside.20closures.20.2385435.html#239794760">(May 21 2021 at 18:38)</a>:</h4>
<p><span class="user-mention" data-user-id="119031">@Esteban Küber</span> ^</p>



<a name="239794850"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/skipped%20unsafe%20blocks%20inside%20closures%20%2385435/near/239794850" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/skipped.20unsafe.20blocks.20inside.20closures.20.2385435.html#239794850">(May 21 2021 at 18:38)</a>:</h4>
<p>So: We can either revert PR <a href="https://github.com/rust-lang/rust/issues/83521">#83521</a> entirely, or I can just put back the feature-gate guard</p>



<a name="239794859"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/skipped%20unsafe%20blocks%20inside%20closures%20%2385435/near/239794859" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/skipped.20unsafe.20blocks.20inside.20closures.20.2385435.html#239794859">(May 21 2021 at 18:38)</a>:</h4>
<p>I’m sort of inclined to do the latter.</p>



<a name="239794943"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/skipped%20unsafe%20blocks%20inside%20closures%20%2385435/near/239794943" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/skipped.20unsafe.20blocks.20inside.20closures.20.2385435.html#239794943">(May 21 2021 at 18:39)</a>:</h4>
<p>Ah!</p>



<a name="239794963"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/skipped%20unsafe%20blocks%20inside%20closures%20%2385435/near/239794963" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/skipped.20unsafe.20blocks.20inside.20closures.20.2385435.html#239794963">(May 21 2021 at 18:39)</a>:</h4>
<p>I would readd the gate, but that means that the bug was latent in nightly</p>



<a name="239794970"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/skipped%20unsafe%20blocks%20inside%20closures%20%2385435/near/239794970" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/skipped.20unsafe.20blocks.20inside.20closures.20.2385435.html#239794970">(May 21 2021 at 18:40)</a>:</h4>
<p>yep</p>



<a name="239794984"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/skipped%20unsafe%20blocks%20inside%20closures%20%2385435/near/239794984" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/skipped.20unsafe.20blocks.20inside.20closures.20.2385435.html#239794984">(May 21 2021 at 18:40)</a>:</h4>
<p>I confirmed that</p>



<a name="239795021"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/skipped%20unsafe%20blocks%20inside%20closures%20%2385435/near/239795021" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/skipped.20unsafe.20blocks.20inside.20closures.20.2385435.html#239795021">(May 21 2021 at 18:40)</a>:</h4>
<p>as you already mentioned <span aria-label="face palm" class="emoji emoji-1f926" role="img" title="face palm">:face_palm:</span></p>



<a name="239795028"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/skipped%20unsafe%20blocks%20inside%20closures%20%2385435/near/239795028" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/skipped.20unsafe.20blocks.20inside.20closures.20.2385435.html#239795028">(May 21 2021 at 18:40)</a>:</h4>
<p>But better a latent bug in nightly guarded by a feature gate</p>



<a name="239795037"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/skipped%20unsafe%20blocks%20inside%20closures%20%2385435/near/239795037" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/skipped.20unsafe.20blocks.20inside.20closures.20.2385435.html#239795037">(May 21 2021 at 18:40)</a>:</h4>
<p>than something that will leak to stable</p>



<a name="239795103"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/skipped%20unsafe%20blocks%20inside%20closures%20%2385435/near/239795103" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/skipped.20unsafe.20blocks.20inside.20closures.20.2385435.html#239795103">(May 21 2021 at 18:40)</a>:</h4>
<p>absolutely</p>



<a name="239795187"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/skipped%20unsafe%20blocks%20inside%20closures%20%2385435/near/239795187" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/skipped.20unsafe.20blocks.20inside.20closures.20.2385435.html#239795187">(May 21 2021 at 18:41)</a>:</h4>
<p>We need to open anew ticket at <a href="https://github.com/rust-lang/project-rfc-2229/issues">https://github.com/rust-lang/project-rfc-2229/issues</a></p>



<a name="239795280"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/skipped%20unsafe%20blocks%20inside%20closures%20%2385435/near/239795280" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/skipped.20unsafe.20blocks.20inside.20closures.20.2385435.html#239795280">(May 21 2021 at 18:42)</a>:</h4>
<p>I think this is what the issue was that kept the gate in place previously: <a href="https://github.com/rust-lang/project-rfc-2229/issues/39">https://github.com/rust-lang/project-rfc-2229/issues/39</a></p>



<a name="239796197"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/skipped%20unsafe%20blocks%20inside%20closures%20%2385435/near/239796197" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/skipped.20unsafe.20blocks.20inside.20closures.20.2385435.html#239796197">(May 21 2021 at 18:49)</a>:</h4>
<p>I’ve opened <a href="https://github.com/rust-lang/rust/issues/85561">#85561</a> to track fixing the root cause on nightly itself.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>